﻿using System.Linq;
using PLM.ConfigurationCenter.Model;
using PLM.ConfigurationCenter.SqlSugar;

namespace PLM.ConfigurationCenter.Service {
    /// <summary>
    /// 
    /// </summary>
    public class SettingService : Repository<SettingModel> {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public SettingModel GetSetting() {
            var setting = CommQuery()?.FirstOrDefault();
            return setting;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public void DeleteSetting() {
            var list = CommQuery();
            foreach (var item in list) {
                Delete(item);
            }
        }

    }
}
